package com.buer.storage.controller;

import com.buer.storage.dto.CorderStorageDto;
import com.buer.storage.entity.CorderResult;
import com.buer.storage.service.CorderResultService;
import com.buer.storage.vo.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/corderResult")
public class CorderResultController {
    @Resource
    private CorderResultService corderResultService;

    @PostMapping("/insertCorderResult")
    public R insert(@RequestBody List<CorderResult> corderResults){
        if (corderResultService.insertCorderResult(corderResults) > 0) {

            return R.setR(1, "盘点结果保存成功", null);
        }

        return R.setR(0,"盘点结果保存失败",null);
    }
}
